<extend name="Public/base"/>
<block name="body">
    <div class="main-title" style="padding-bottom: 10px;">
        <h2>消耗品申请审核</h2>
    </div>
    <div class="cf">
        <div class="fl">

        </div>
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-body">
            <div class="row">
                <div class="col-md-10">
                    <h4><a class="btn btn-default" href="{:U('index')}">返 回</a> 批次号：
                        <mark>{$data.batch}</mark>
                        申请部门：
                        <mark>{$data.dpid|get_subpro_department_name}</mark>
                        申请时间：
                        <mark>{$data.createAt|time_format}</mark>
                        状态：
                        <mark class="text-danger"> {$data.status|get_subpro_applystatus_name}</mark>
                    </h4>
                </div>
                <!--<div class="col-md-2 text-right"><a class="btn btn-default" href="{:U('printf')}&id={$data.id}"
                                                    target="_blank">打印</a></div>-->
            </div>
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading">{$data.batchNum} 进货单详情</div>
        <div class="panel-body data-table table-striped">
            <form method="POST" action="{:U('Subpro/applychangestatus')}" id="formSubmit" class="form1">
                <input type="hidden" name='id' value='{$data.id}'/>
                <table class="">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>商品名称</th>
                        <th>规格</th>
                        <th>申请数量</th>
                        <th>单价</th>
                        <th>总价</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name='_list' id='vo'>
                        <tr>
                            <td>{$i}</td>
                            <td>{$vo.BIN|get_subpro_product_name}</td>
                            <td>{$vo.spec}</td>
                            <td>{$vo.cnt}</td>
                            <td>{$vo.unitprice}</td>
                            <td>{$vo.totalprice}</td>
                        </tr>
                    </volist>
                    </tbody>
                </table>
                <!--备注信息：<br/>
                <textarea class="form-control" name='remark' rows="3">{$data.remark}</textarea>-->
                <div class="text-center" style="margin-top:20px;">
                    <eq name='data.status' value='1'>
                        <label class="radio-inline">
                            <input type="radio" name='status' value="2" checked> 通过

                        </label>
                        <label class="radio-inline">
                            <input type="radio" name='status' value="3"> 不通过
                        </label><br/><br/>
                    </eq>
                    <input type="hidden" name="batch" value="{$data.batch}" />
                    <input type="submit" value="审核" class="btn btn-success" />
                </div>
                <!--<div class="text-center" style="margin-top:20px;">

                    <eq name='data.status' value='1'>
                        <label class="radio-inline">
                            <input type="radio" name='status' value="2" checked> 审核通过
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name='status' value="3"> 拒绝请求
                        </label><br/><br/>
                    </eq>

                    <eq name='data.status' value='1'><input type="hidden" name='status' value="2"/></eq>
                    <eq name='data.status' value='2'><input type="hidden" name='status' value="4"/></eq>
                    <in name="data.status" value="1,2,4">
                        <button type='button' class='btn btn-primary ajax-post' target-form="form1"
                                onclick="return confirmIt()">{$btnStr}
                        </button>
                    </in>

                </div>-->
            </form>
        </div>
    </div>


</block>


<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
        //搜索查询
        $('#submit').click(function () {
            document.getElementById("form-search").submit();
        });

        function confirmIt() {
            if ($("input[name=status]").val() == "30") {
                if (confirm("即将确认发货，请确定实发数量填写无误")) {
                    $("#formSubmit").submit();
                }
            } else {
                $("#formSubmit").submit();
            }
        }
        //导航高亮
        highlight_subnav('{:U('Subpro/applyreview')}');
    </script>
</block>